import { post, get } from "@/utils/ajax";

// 查询列表
export const search = ( data: any ) => {
    return post('/uni/entity/info/search',data, {
        "Content-Type": "multipart/form-data",
    });
}
// 新增
export const insert = (params) => {
    return post('/uni/entity/info/insert', params, {
        "Content-Type": "multipart/form-data",
    });
}
// 删除
export const deleteByIds = (ids) => {
  return post('/uni/entity/info/deleteByIds', {ids: ids}, {
      "Content-Type": "multipart/form-data",
  });
}
// 更新
export const updateById = (params) => {
    return post('/uni/entity/info/updateRowNotNullById', params, {
        "Content-Type": "multipart/form-data",
    });
}
// 根据ID获取
export const selectById = (id) => {
    return post('/uni/entity/info/selectById',  {id: id}, {
        "Content-Type": "multipart/form-data",
    });
}

// 实体树
export const entityTreeList = (params) => {
    return post('/uni/entity/info/entityTreeList', params, {
        "Content-Type": "multipart/form-data",
    });
}

// 查询列表
export const searchAll = (query) => {
    return post({ url: '/uni/entity/info/searchAll', query });
}

// 新增模型实体
export const insertModelEntity = (params) => {
    return post( '/uni/entity/info/insertModelEntity', params, {
        "Content-Type": "multipart/form-data",
    });
}

// 复制模型实体
export const copyModel = (params) => {
    return post('/uni/entity/info/copyModel', params, {
        "Content-Type": "multipart/form-data",
    });
}

// 新增模型实体
export const getAttributeList = (params) => {
    return post('/uni/entity/info/getAttributeList', params)
}

// 批量新增模型实体
export const importFromDataSource = (params) => {
    return post('/uni/entity/info/importFromDataSource', params)
}

// 列表查询所有实体
export const selectAllParentEntity = (params) => {
    return post('/uni/entity/info/selectAllParentEntity', params)
}

// 获取实体列表
export const getTableList = (params) => {
    return post('/uni/entity/info/getTableList', params)
}

// 同步实体模型列表
export const refreshEntityInfo = (params) => {
    return post('/uni/entity/info/refreshEntityInfo', params)
}